<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 400px;
            margin: 200px auto;
            font-size: 14px;
            text-align: center;
        }
        .ipt{
            width: 200px;
            height: 30px;
            line-height: 5px;
            border:0;
            border-bottom: 1px solid #ccc;
            outline: none;
        }
        .btn{
            border: 0;
            outline: none;
        }
    </style>
</head>
<body>
    <div>
        <input type="number" placeholder="请输入号码" class="ipt"> <button class="btn">发送</button>
    </div>
    <script>
        var btn = document.querySelector('.btn');
        var countdown = 3;
        btn.addEventListener('click',function(){
            this.disabled = true;
            
            var time = setInterval(function(){
                if(countdown == 0){
                    clearInterval(time);
                    btn.disabled = false;
                    btn.innerHTML = '发送';
                    countdown = 3;  
                }else{
                    btn.innerHTML = countdown;
                    countdown--;
                }
            },1000);
        });
    </script>
</body>
</html>